// api/modules/user.js
import request from "../request";

export default {
  /**
   * 获取用户详细信息
   * @returns {Promise} 包含用户数据的Promise
   */
  getUserInfo() {
    return request.get("/api/user/user-info");
  },
  updateUserInfo(data) {
    return request.post("/api/user/updateUserInfo", data);
  },
  byRole(roleName) {
    return request.get(`/api/user/byRole/${roleName}`);
  },
  toggleUserStatus(userId, status) {
    return request.post("/api/user/disable-user", {
      userId: userId,
      status: status,
    });
  },
  resetUserPassword(userId) {
    return request.post("/api/user/reset-password", {
      userId: userId,
    });
  },
  selectUserCount() {
    return request.get("/api/user/selectUserCount");
  },
};
